home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998…eptember: Technology Seed / September 98 ADC Seed CD.toast / LaserWriter 8.6b5 Seed / LaserWriter 8.6b5 / PrintingLib / PrintingLib.rsrc / PS_-8178 < prev    next >
Encoding:
Text File  |  1998-08-12  |  2.0 KB  |  191 lines

  1. %%BeginFile: lw8_level1_basicimages-2.1
  2. /$i F def
  3. /flipinvert
  4. statusdict begin
  5. version cvr 47.0 lt
  6. end
  7. def
  8. /iw Z
  9. /ih Z
  10. /im_save Z
  11. /setupimageproc Z
  12. /polarity Z
  13. /smoothflag Z
  14. /$z Z
  15. /bpc Z
  16. /smooth_moredata Z
  17. /datatype Z
  18. /xtraData Z
  19. /$zdump Z
  20. /miascii
  21. {
  22. [
  23. currentfile dup
  24. $zdump
  25. /readhexstring cvx
  26. /pop cvx dup
  27. $z
  28. /readhexstring cvx
  29. /pop cvx
  30. ]cvx bind
  31. }bd
  32. /mibinary
  33. {
  34. [
  35. currentfile dup
  36. $zdump
  37. /readstring cvx
  38. /pop cvx dup
  39. $z
  40. /readstring cvx
  41. /pop cvx
  42. ]cvx bind
  43. }bd
  44. /:imsv{/im_save save store}bd
  45. /:f
  46. {
  47. /xtraData xs
  48. /datatype xs
  49. $i flipinvert
  50. and
  51. xor
  52. /polarity xs
  53. /smoothflag xs
  54. 2 index 1 eq
  55. {
  56. dup aload pop
  57. transform
  58. round 0.5 sub exch
  59. round 0.5 sub exch
  60. itransform
  61. 7 -1 roll astore
  62. }if
  63. concat
  64. xtraData
  65. {
  66. 0 0 1 1
  67. 1 1 idtransform abs exch pop
  68. add
  69. rC
  70. }if
  71. /$z exch string store
  72. /bpc xs
  73. xtraData{4 add}if
  74. /ih xs
  75. /iw xs
  76. datatype 13 ge
  77. {
  78. /$zdump iw 7 add 8 idiv string store
  79. }if
  80. /smoothflag
  81. smoothflag
  82. bpc 1 eq and
  83. smoothflag and
  84. userdict/sc_smooth known and
  85. vmstatus pop exch pop iw 3 mul sub 1000 gt and
  86. iw 4 mul 7 add 8 idiv 4 mul 65535 le and
  87. store
  88. smoothflag{
  89. iw
  90. ih
  91. $z
  92. iw 7 add 8 idiv 4 mul string
  93. iw 4 mul 7 add 8 idiv 4 mul string
  94. T
  95. F
  96. sc_initsmooth
  97. /iw iw 4 mul store
  98. /ih ih 4 mul store
  99. }if
  100. /setupimageproc
  101. smoothflag{
  102. {
  103. [
  104. /smooth_moredata cvx
  105. datatype 13 lt{
  106. [
  107. currentfile
  108. $z
  109. {readstring readhexstring}datatype get
  110. /pop cvx
  111. ]cvx
  112. }{
  113. {mibinary miascii}datatype 13 sub get exec
  114. }ifelse
  115. [
  116. $z
  117. ]cvx/ifelse cvx
  118. /sc_smooth cvx
  119. /smooth_moredata/exch cvx/store cvx
  120. ]cvx bind
  121. /smooth_moredata T store
  122. dup exec pop dup exec pop
  123. }
  124. }{
  125. {
  126. datatype 13 lt
  127. {
  128. [
  129. currentfile
  130. $z
  131. {readstring readhexstring}datatype get
  132. /pop cvx
  133. ]cvx bind
  134. }{
  135. {mibinary miascii}datatype 13 sub get exec
  136. }ifelse
  137. }
  138. }ifelse
  139. store
  140. }bd
  141. /mkimgmtx
  142. {
  143. xtraData
  144. {
  145. smoothflag
  146. {
  147. [iw 0 0 ih 16 sub 0 8]
  148. }{
  149. [iw 0 0 ih 4 sub 0 2]
  150. }ifelse
  151. }{
  152. [iw 0 0 ih 0 0]
  153. }ifelse
  154. }bd
  155. /do1img
  156. {
  157. iw ih
  158. polarity
  159. mkimgmtx
  160. setupimageproc
  161. imagemask
  162. }bd
  163. /:j{im_save restore}bd
  164. /:g
  165. {
  166. 1 setgray
  167. 0
  168. 1 1 idtransform abs exch pop
  169. 1 1
  170. rF
  171. 0 setgray
  172. do1img
  173. }bd
  174. /:h
  175. {
  176. :Fx
  177. 0
  178. 1 1 idtransform abs exch pop
  179. 1 1
  180. rF
  181. :Fx
  182. do1img
  183. }bd
  184. /:i
  185. {
  186. :Fx
  187. do1img
  188. }bd
  189. /:hm/:h ld
  190. %%EndFile
  191.